export interface Product {
  id: number
  mer_id: number
  image: string
  recommend_image: string
  slider_image: string[]
  store_name: string
  store_info: string
  keyword: string
  bar_code: string
  cate_id: string
  price: string
  vip_price: string
  ot_price: string
  postage: string
  unit_name: string
  sort: number
  sales: number
  stock: number
  is_show: number
  is_hot: number
  is_benefit: number
  is_best: number
  is_new: number
  add_time: number
  is_postage: number
  is_del: number
  mer_use: number
  give_integral: number
  cost: string
  is_seckill: number
  is_bargain: null
  is_good: number
  is_sub: number[]
  is_vip: number
  ficti: number
  browse: number
  code_path: string
  soure_link: string
  video_link: string
  temp_id: number
  spec_type: number
  activity: string[]
  spu: string
  label_id: string[]
  command_word: string
  coupons?: string[]
  description: string
  items: any[]
  collect: number
  likes: number
  visitor: number
  cate_name: string
  stock_attr: boolean
  statusLoading?: boolean
}

export interface ProductType {
  type: number
  name: string
  count: number
}

export interface ProductListParams {
  page?: number
  limit?: number
  cate_id?: number
  type?: 0 | 1 | 2 | 3 | 4 | 5 | 6
  store_name?: string
  sales?: 'normal' | 'desc' | 'asc'
}

export interface CategoryListParams {
  pid?: number
  is_show?: 0 | 1
  page: number
  cate_name?: string
  limit?: number
}

export interface ProductCategory {
  add_time: string
  big_pic: string
  cate_name: string
  html: string
  id: number
  is_show: 0 | 1
  pic: string
  pid: number
  sort: number
  children?: ProductCategory[]
  statusLoading?: boolean
}

export interface AttrRuleValue {
  value: string
  detail: string[]
  inputVisible?: boolean
  inputValue?: string
}

export interface ProductAttrTpl {
  id: number
  attr_name: string
  rule_name: string
  attr_value: string[]
  rule_value: AttrRuleValue[]
}

export interface IExpressTemplate {
  id: number
  name: string
}

export interface AttrTableHeader {
  align: string
  key: string
  minWidth: number
  title: string
}

export type ProductAttr = Record<string, any> & {
  pic: string
  vip_price: number
  price: number
  cost: number
  ot_price: number
  stock: number
  bar_code: string
  weight: number
  volume: number
  brokerage: number
  brokerage_two: number
}

export interface CategoryParentOption {
  value: number
  label: string
}

export interface CategoryForm {
  cate_name: string
  pid?: string
  sort: number
  pic?: string
  is_show?: number
}

export interface RuleSpec {
  value: string
  detail: string[]
  tmpDetail?: string
}

export interface RuleForm {
  id?: number
  rule_name: string
  rule_value: string
  spec: RuleSpec[]
}

export interface RuleListParams {
  page?: number
  rule_name?: string
  limit?: number
}
export interface Rule {
  id?: number
  rule_name: string
  rule_value: string
  attr_name: string
  attr_value: string[]
  statusLoading?: boolean
}

export interface RuleDetail {
  info: {
    id: number
    rule_name: string
    rule_value: string
    spec: RuleSpec[]
  }
}

export interface ReplyListParams {
  page: number
  limit: number
  account?: string
  is_reply?: 0 | 1
  store_name?: string
  data?: string
  product_id: number
}

export interface Reply {
  statusLoading?: boolean
  id: number
  uid: number
  oid: number
  unique: string
  product_id: number
  reply_type: string
  product_score: number
  service_score: number
  comment: string
  pics: string[] | null
  add_time: string
  merchant_reply_content: '1'
  merchant_reply_time: number | string
  is_del?: 0 | 1 | null
  is_reply?: 0 | 1 | null
  nickname: string
  avatar: string
  store_name: string
  image: string
  account: string
  time: string
  create_time: string
  score: number
}

export interface ReplyForm {
  id?: number
  content: string
}
export interface IImage {
  image: string
  product_id: number
}
export interface FictitiousReply {
  image: IImage
  avatar: string
  nickname: string
  comment: string
  product_score: number
  service_score: number
  pics: string[]
  add_time?: string
}
